package com.mybatis.service;

import com.mybatis.mapper.UserMapper;
import com.mybatis.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

@Service
public class UserServiceImpl implements UserService {

	@Autowired
	private UserMapper userMapper;

	@Override
	public List<User> getUserByName(String name) {
		User user = userMapper.selectUserByName(name);
		User user1 = userMapper.selectUserByAge(18);
		ArrayList<User> users = new ArrayList<>();
		users.add(user);
		users.add(user1);
		return users;
	}
}
